//
//  UIBarButtonItem+Extention.swift
//  新浪
//
//  Created by lcc on 16/5/11.
//  Copyright © 2016年 lcc. All rights reserved.
//

import UIKit

extension UIBarButtonItem {

    convenience init(title: String, fontSize: CGFloat) {
        self.init()
        
        let button = UIButton()
        
        button.setTitle(title, forState: .Normal)
        //设置文字颜色
        button.setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
        button.setTitleColor(UIColor.orangeColor(), forState: .Highlighted)
        button.titleLabel?.font = UIFont.systemFontOfSize(fontSize)
        button.sizeToFit()
        
        customView = button
    }
}